<?php
$this->breadcrumbs=array(
	'החשבון שלי'=>array('/site/panel'),
	'ניהול משתמשים',
);
?>
<div dir="rtl"> <!-- Rtl Align -->
<?php
$h3 = ($active) ? 'ניהול משתמשים פעילים' : 'ניהול משתמשים לא פעילים';
$h4 = ($active) ? 'משתמשים פעילים'   : 'משתמשים לא פעילים';
$this->renderPartial('_menu_manage_users', array('h3'=>$h3));?>

<h4><?=$h4?></h4>
<div class='grbac'>
<table>
  <thead>
  <tr>
    <th> id </th>
    <th><?php echo $sort->link('username'); ?></th>
    <th><?php echo $sort->link('namef'); ?></th>
    <th><?php echo $sort->link('namel'); ?></th>
    <th>email</th>
    <th><?php echo $sort->link('created'); ?></th>
    <th><?php echo $sort->link('lastlogin'); ?></th>
    <th>&nbsp;</th>
  </tr>
  </thead>
  <tbody>
<? foreach($users as $n=>$user) { 
	 $id = $user->id; ?>
     <tr class="<?=($n%2)?'grbac_even':'grbac_odd'?>" id='tr_<?=$id?>'> 
	     <td><?=$user->id?> </td>
	     <td><?=$user->username?> </td>
	     <td><?=$user->namef?> </td>
             <td><?=$user->namel?> </td>
	     <td>מוסתר כאן </td>
	     <td><?=date("d/m/Y",strtotime($user->created))?> </td>
	     <td><?=$user->lastlogin?> </td>
	     <td>
		      <? echo CHtml::Link ('<b class="grbac_e" title="View/Edit">&nbsp;</b>', array('user_edit','id'=>$id))?>
			  <? echo CHtml::ajaxLink ("<b class='grbac_onoff_{$user->active}' title='Set Active/Inactive'>&nbsp;</b>", CController::createUrl('toggle_active') 
		     	,array('type'=>'POST','data'=> array('id'=> $id),
                        'success'   => "function(){\$('#tr_$id').fadeToggle('slow'); return false;}")); ?>
		 </td>
      </tr>
<? } ?>
</table>
</div>
<br />
<?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>
</div>
<script type="text/javascript">
/*<![CDATA[*/
jQuery.fn.fadeToggle = function(speed, easing, callback) {
   return this.animate({opacity: 'toggle'}, speed, easing, callback);
};
/*]]>*/
</script>